package com.tencent.sr.iris.basic.saas.service.model.operate;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.tencent.sr.iris.activity.interfaces.response.group.operate.OperateThirdBoardResponse;
import com.tencent.sr.iris.basic.saas.common.enums.IrisPromoteStatusEnum;
import com.tencent.sr.iris.basic.saas.common.utils.CommonUtils;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

@Data
@ApiModel(value = "运营平台-特殊团推团导出信息")
@Slf4j
@ColumnWidth(15)
public class OperateThirdBoardSpecialInviteExportInfo {

    @ExcelProperty(value = "序号", index = 0)
    private int num;
    
    @ExcelProperty(value = "贡献状态", index = 1)
    private String promoteStatus;
    
    @ExcelProperty(value = "成为特邀时间", index = 2)
    private String promoteUserInviteDatetime;

    @ExcelProperty(value = "uid", index = 3)
    private String irisUid;

    @ExcelProperty(value = "unionId", index = 4)
    private String wechatUserUnionid;

    @ExcelProperty(value = "昵称", index = 5)
    private String wechatUserNickname;
    
    @ExcelProperty(value = "贡献阶段", index = 6)
    private String settleTime;

    @ExcelProperty(value = "贡献销售额", index = 7)
    private Double promoteGmv;
    
    @ExcelProperty(value = "贡献奖励金", index = 8)
    private Double predictCommissionFee;

    @ExcelProperty(value = "累计贡献销售额", index = 9)
    private Double sumPromoteGmv;

    @ExcelProperty(value = "当月贡献收益", index = 10)
    private Double validCommissionBillCommissionFee;

    @ExcelProperty(value = "累计贡献收益", index = 11)
    private Double sumValidCommissionBillCommissionFee;

    @ExcelProperty(value = "累计贡献奖励金", index = 12)
    private Double sumPredictCommissionFee;;


    public void readFromSearchResponseData(OperateThirdBoardResponse response) {
        this.setIrisUid(response.getIrisUid());
        this.setWechatUserUnionid(response.getWechatUserUnionid());
        this.setWechatUserNickname(response.getWechatUserNickname());
        
        this.setPromoteStatus(IrisPromoteStatusEnum.getByStatus(response.getPromoteStatus()));
        this.setPromoteUserInviteDatetime(response.getPromoteUserInviteDatetime());
        this.setSettleTime(response.getDayStart()+ "-" + response.getDayEnd() + "天");

        this.setPromoteGmv(CommonUtils.longToDouble(response.getPromoteGmv()));
        this.setPredictCommissionFee(CommonUtils.longToDouble(response.getPredictCommissionFee()));
        this.setSumPromoteGmv(CommonUtils.longToDouble(response.getSumPromoteGmv()));
        this.setSumPredictCommissionFee(CommonUtils.longToDouble(response.getSumPredictCommissionFee()));

        this.setValidCommissionBillCommissionFee(CommonUtils.longToDouble(response.getValidCommissionBillCommissionFee()));
        this.setSumValidCommissionBillCommissionFee(CommonUtils.longToDouble(response.getSumValidCommissionBillCommissionFee()));
    }


}
